package cn.lxh.exception;

import cn.lxh.constants.ErrorCode;

//全局异常
public class GlobalException extends RuntimeException{

    // 错误码
    private int code;

    public GlobalException(String message){
        super(message);
    }

    public GlobalException(int code, String message){
        super(message);
        this.code = code;
    }

    public GlobalException(ErrorCode errorCode){
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
    }
}
